---
title: bud.use
description: Function to register an extension or array of extensions
tags:
  - configuration
  - extensions
---

Register an extension or set of extensions.

## Usage

Add extensions:

```ts title=bud.config.ts
import swc from '@roots/bud-swc'

export default async bud => {
  bud.use(swc)
}
```

You can register multiple extensions at once by passing an array of extensions.

```ts title=bud.config.ts
import swc from '@roots/bud-swc'
import react from '@roots/bud-react'

export default async bud => {
  bud.use([swc, react])
}
```

Add an extension inline (also works with an array of extensions):

```ts title=bud.config.ts
bud.use({
  name: 'my-webpack-plugin',
  make: () => new MyWebpackPlugin(),
})
```

Add a webpack plugin inline (also work with an array of plugins):

```ts title=bud.config.ts
bud.use(new MyWebpackPlugin())
```

Add an extension or plugin from its signifier (must be the default export):

```ts title=bud.config.ts
bud.use(`my-webpack-plugin`)
```

## Additional information

You can register multiple extensions at once by passing an array of extensions.

If your extension is listed in `package.json` dependencies or devDependencies it is not necessary to call **bud.use**.
The extensions will be discovered automatically.
